import http from '../../http'
import { CLASS_MANAGE_URL } from './PATH.js'
import { ACCOUNT_CENTER_SYSTEM } from '../../host.js'

// 获取任教班级
export async function getTeachClassList(data) {
  return http.post(ACCOUNT_CENTER_SYSTEM + CLASS_MANAGE_URL.teachClasses, data)
}

// 获取管理班级
export async function getAdminClassList(data) {
  return http.post(ACCOUNT_CENTER_SYSTEM + CLASS_MANAGE_URL.adminClasses, data)
}

// 行政班学生列表
export async function getAdminStudents(params) {
  return http.get(ACCOUNT_CENTER_SYSTEM + CLASS_MANAGE_URL.studentList, {
    params
  })
}

// 教学班学生列表
export async function getTeachStudents(params) {
  return http.get(ACCOUNT_CENTER_SYSTEM + CLASS_MANAGE_URL.teachStudentList, {
    params
  })
}

// 创建靶向班
export async function postAddTargetClass(data) {
  return http.post(
    ACCOUNT_CENTER_SYSTEM + CLASS_MANAGE_URL.addTargetClass,
    data
  )
}

// 靶向班添加学生关联数据
export async function postAddTargetClassStudent(data) {
  return http.post(
    ACCOUNT_CENTER_SYSTEM + CLASS_MANAGE_URL.addTargetClassStudent,
    data
  )
}

// 更新靶向班
export async function postUpdateTargetClass(data) {
  return http.post(
    ACCOUNT_CENTER_SYSTEM + CLASS_MANAGE_URL.updateTargetClass,
    data
  )
}

// 删除靶向班
export async function postDeleteTargetClass(data) {
  return http.post(
    ACCOUNT_CENTER_SYSTEM + CLASS_MANAGE_URL.deleteTargetClass,
    data
  )
}

// 获取老师的学科列表
export async function getSubjectList(data) {
  return http.post(ACCOUNT_CENTER_SYSTEM + CLASS_MANAGE_URL.subjectList, data)
}

// 获取靶向班学生列表
export async function getTargetClassStudents(params) {
  return http.get(
    ACCOUNT_CENTER_SYSTEM + CLASS_MANAGE_URL.targetClassStudents,
    {
      params
    }
  )
}

// 可见范围内的靶向班列表
export async function getVisibleTargetClasses(params) {
  return http.get(
    ACCOUNT_CENTER_SYSTEM + CLASS_MANAGE_URL.visibleTargetClasses,
    {
      params
    }
  )
}

// 设置靶向班可见范围
export async function postSetVisibleRange(data) {
  return http.post(
    ACCOUNT_CENTER_SYSTEM + CLASS_MANAGE_URL.setVisibleRange,
    data
  )
}

// 删除靶向班学生
export async function postDeleteTargetStudent(data) {
  return http.post(
    ACCOUNT_CENTER_SYSTEM + CLASS_MANAGE_URL.deleteTargetStudent,
    data
  )
}
